package com.example.demo.demos.web;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

@Service
@Slf4j
@RequiredArgsConstructor
public class InventoryServiceImpl implements InventoryService {
    private final InventoryMapper inventoryMapper;


    @Transactional(rollbackFor = Exception.class)
    @Override
    public void insertInventory() {
        String inventoryId = String.valueOf(100);
        InventoryPO inventoryPO = new InventoryPO();
        inventoryPO.setInventoryId(inventoryId);
        inventoryPO.setRemark("remark");
        inventoryPO.setStatus(0);
        inventoryPO.setCreateTime(LocalDateTime.now());
        inventoryMapper.insert(inventoryPO);
//        int aa = 1/0;
//        throw new RuntimeException("货架号已创建盘点单");
//        return null;
    }
}
